File

public interface File

File data.

Depending on how the File instance is created, it can correspond to one of the following:

  1. File path, if the file is selected from an <input type="file"> element in a submitted form.
  2. File bytes, if the request is created via the JavaScript API, and a file is passed as a part of the multipart/form-data body.

Types

Link copied to clipboard
public final class Builder
A builder of File.

Properties

Link copied to clipboard
public final ByteArray bytesValue
public final ByteArray bytesValue

The file value as an array of bytes, if any.

Link copied to clipboard
public final MimeType mimeType
public final MimeType mimeType

A MIME type of the file content.

Link copied to clipboard
public final Path pathValue
public final Path pathValue

The file value as a path, if any.

Functions

Link copied to clipboard
public Optional<Array<byte>> bytesValue()
Returns the file value as an array of bytes.
Link copied to clipboard
Returns the content type.
Link copied to clipboard
public String name()
Returns the file name.
Link copied to clipboard
public static File.Builder newBuilder()
Creates a new File builder.
Link copied to clipboard
Returns the file value as a file path.